<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$return['member']=array();
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_SESSION['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $fields=array('id','order_id','mid','price','content','createtime','status');
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_taxi_invoice',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	$status=array('0'=>'待审核','1'=>'待打印','2'=>'待收货','3'=>'已完成');
	foreach($return['list'] as &$v){
			$v['ordersn']=pdo_getcolumn('jy_taxi_order',array('id'=>$v['order_id']),'ordersn');
			$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
			$n=$v['status'];
			$v['status']=$status[$n];
	}
	//print_r($return['list']);exit();
	exi($return);
	}
if($_RQ['op']=='detail'){
	$id=intval($_RQ['id']);
	if(!$id){
		exi('请先选择发票','error','list');
	}
	$return['item']=pdo_get('jy_taxi_invoice',array('id'=>$id));
	$return['item']['createtime']=date('Y-m-d H:m:s',$return['item']['createtime']);
	exi($return);
}
